home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Apple Shared Library Manager / ASLM 2.0.1 Licensing Disk / Sources / ASLMFramework.r < prev    next >
Encoding:
Text File  |  1996-11-19  |  8.1 KB  |  357 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ASLMFramework.r
  3.  
  4.     Contains:    The ASLM Installer framework
  5.  
  6.     Copyright:    © 1993-1994 by Apple Computer, Inc., all rights reserved.
  7.  
  8. */
  9.  
  10.  
  11. #include "ASLMDefines.r"
  12.  
  13. #include "ASLMAssertionRules.r"
  14. #include "ASLMDescriptionRules.r"
  15. #include "ASLMErrorRules.r"
  16. #include "ASLMPackageRules.r"
  17.  
  18. #include "ASLMAtoms.r"
  19. #include "ASLMFileSpecs.r"
  20. #include "ASLMPackages.r"
  21.  
  22.  
  23. #if INTERNATIONAL
  24.  
  25. /*    -------------------------------------------------------------------------
  26.     Put assertion IDs for each country here
  27.     IntlSLMBase thru IntlSLMBase+199 are available
  28.     ------------------------------------------------------------------------- */
  29.  
  30. #define isUS                        IntlSLMBase+0
  31. #define isFrance                    IntlSLMBase+1
  32. #define isGermany                    IntlSLMBase+3
  33. #define isItaly                        IntlSLMBase+4
  34. #define isHolland                    IntlSLMBase+5
  35. #define isSweden                    IntlSLMBase+7
  36. #define isSpain                        IntlSLMBase+8
  37. #define isDenmark                    IntlSLMBase+9
  38. #define isFinland                    IntlSLMBase+17
  39.  
  40. #endif
  41.  
  42. /*******************************************************************************
  43. ** Rules to determine the country we're running in
  44. ********************************************************************************/
  45.  
  46. #if INTERNATIONAL
  47.  
  48. resource 'inrl' (isFrance)
  49. {
  50.     format0
  51.     {{
  52.             checkUserFunction {'CNTY', 0, 1},
  53.             addAssertion {{isFrance}}
  54.     }};
  55. };
  56.  
  57. resource 'inrl' (isGermany)
  58. {
  59.     format0
  60.     {{
  61.             checkUserFunction {'CNTY', 0, 3},
  62.             addAssertion {{isGermany}}
  63.     }};
  64. };
  65.  
  66. resource 'inrl' (isItaly)
  67. {
  68.     format0
  69.     {{
  70.             checkUserFunction {'CNTY', 0, 4},
  71.             addAssertion {{isItaly}}
  72.     }};
  73. };
  74.  
  75. resource 'inrl' (isHolland)
  76. {
  77.     format0
  78.     {{
  79.             checkUserFunction {'CNTY', 0, 5},
  80.             addAssertion {{isHolland}}
  81.     }};
  82. };
  83.  
  84. resource 'inrl' (isSweden)
  85. {
  86.     format0
  87.     {{
  88.             checkUserFunction {'CNTY', 0, 7},
  89.             addAssertion {{isSweden}}
  90.     }};
  91. };
  92.  
  93. resource 'inrl' (isSpain)
  94. {
  95.     format0
  96.     {{
  97.             checkUserFunction {'CNTY', 0, 8},
  98.             addAssertion {{isSpain}}
  99.     }};
  100. };
  101.  
  102. resource 'inrl' (isDenmark)
  103. {
  104.     format0
  105.     {{
  106.             checkUserFunction {'CNTY', 0, 9},
  107.             addAssertion {{isDenmark}}
  108.     }};
  109. };
  110.  
  111. resource 'inrl' (isFinland)
  112. {
  113.     format0
  114.     {{
  115.             checkUserFunction {'CNTY', 0, 17},
  116.             addAssertion {{isFrance}}
  117.     }};
  118. };
  119.  
  120. /* US is the default if no one else matched    */
  121.  
  122. resource 'inrl' (isUS)
  123. {
  124.     format0
  125.     {{
  126.             addAssertion {{isUS}}
  127.     }};
  128. };
  129.  
  130. #endif
  131.  
  132. /*******************************************************************************
  133. ** The Global Framework
  134. ********************************************************************************/
  135.  
  136. resource 'infr' (kGlobalFrameworkRsrcID)
  137. {
  138.     format0
  139.     {{
  140. #if INTERNATIONAL
  141.         /*    -----------------------------------------------------------------
  142.             First, determine the country we're running in
  143.             ----------------------------------------------------------------- */
  144.         pickFirst,    {
  145.                         /* Put individual country rules here    */
  146.                         isFrance,
  147.                         isGermany,
  148.                         isItaly,
  149.                         isHolland,
  150.                         isSweden,
  151.                         isSpain,
  152.                         isDenmark,
  153.                         isFinland,
  154.                         isUS
  155.                     },
  156. #endif                        
  157.                     
  158.         /*    -----------------------------------------------------------------
  159.             See if EtherTalk Phase 2 is already installed
  160.             ----------------------------------------------------------------- */
  161.         pickFirst,    {
  162.                         rCheckForEtherTalk,
  163.                         rCheckForEtherTalk2_0,
  164.                         rCheckForEtherTalk2_1,
  165.                         rCheckForEtherTalkPhase2
  166.                         /* Put individual Country Messages here    */
  167. #if INTERNATIONAL
  168. #endif
  169.                     },
  170.                     
  171.         /*    -----------------------------------------------------------------
  172.             See if there is a system file.  If not, inform the user
  173.             ----------------------------------------------------------------- */
  174.         pickFirst,    {
  175.                         rCheckForAnySystem, 
  176.                         /* Put individual Country Messages here    */
  177. #if INTERNATIONAL
  178. #endif
  179.                         rAssertNoSystemError
  180.                     },
  181.  
  182. #if GENERATING68K
  183.     #if SYSTEM6
  184.     
  185.             /*    -----------------------------------------------------------------
  186.                 See if we have system 6.0.5 or higher.  If we don't - tell the 
  187.                 user the bad news.
  188.                 ----------------------------------------------------------------- */
  189.             pickFirst,    {
  190.                             rCheckForSystemAUX,
  191.                             rCheckForSystem7,
  192.                             rCheckForSystem6,
  193.                             /* Put individual Country Messages here    */
  194.     #if INTERNATIONAL
  195.     #endif
  196.                             rAssertBadSystemError
  197.                         },
  198.     #else
  199.     
  200.             /*    -----------------------------------------------------------------
  201.                 If earlier than system 7 - tell the user
  202.                 ----------------------------------------------------------------- */
  203.             pickFirst,    {
  204.                             rCheckForSystem7,
  205.                             /* Put individual Country Messages here    */
  206.     #if INTERNATIONAL
  207.     #endif
  208.                             rAssertSystem7OnlyError
  209.                         },
  210.     
  211.     #endif
  212. #endif
  213.  
  214. #if GENERATINGPOWERPC
  215.             /*    -----------------------------------------------------------------
  216.                 Check to see if running on a PowerPC. If we are not then give an
  217.                 error if this is a PowerPC only installer
  218.                 ----------------------------------------------------------------- */
  219.             pickFirst,    {
  220.                             rCheckForSystemPPC,
  221.     #if !GENERATING68K
  222.                             rAssertPowerPCOn68KError
  223.     #endif
  224.                         },
  225. #endif
  226.                     
  227.     }};
  228. };
  229.  
  230. /*******************************************************************************
  231. ** The Easy Install framework
  232. ********************************************************************************/
  233.     
  234. resource 'infr' (kEasyInstallFrameworkRsrcID)
  235. {
  236.     format0
  237.     {{
  238.  
  239.         /*    -----------------------------------------------------------------
  240.             These two rules will set the "newer version" assertion if the
  241.             installed version of ASLM is later then the one we are installing.
  242.             This keeps us from "easy installing" an older version.
  243.             ----------------------------------------------------------------- */
  244.             
  245.         pickFirst,    {
  246. #if GENERATING68K
  247.                         rCheckForLater68kASLM,
  248. #endif
  249. #if GENERATINGPOWERPC
  250.                         rCheckForLaterPPCASLM
  251. #endif
  252.                     },
  253.  
  254.         /*    -----------------------------------------------------------------
  255.             Report any errors that occured.
  256.             ----------------------------------------------------------------- */
  257.             
  258.         pickFirst,    {
  259.                         rReportNoSystemError,
  260. #if GENERATING68K
  261.     #if SYSTEM6
  262.                         rReportBadSystemError,
  263.     #else
  264.                         rReportSystem7OnlyError,
  265.     #endif
  266. #endif
  267. #if GENERATINGPOWERPC && !GENERATING68K
  268.                         rReportPowerPCOn68KError,
  269. #endif
  270.                         rReportNewerVersionError
  271.                     },
  272.                     
  273.         /*    -----------------------------------------------------------------
  274.             By here, we know we have Easy Install, so let's do the
  275.             descriptions.
  276.             ----------------------------------------------------------------- */
  277.         pickAll,    {
  278.                         /* Put Each Countries descriptions in here    */
  279. #if INTERNATIONAL
  280. #endif
  281.                         /* US Descriptions    */
  282.                         rAddClickDescription,
  283. #if GENERATING68K
  284.                         rAdd68kASLMDescription,
  285. #endif
  286. #if GENERATINGPOWERPC
  287.                         rAddPPCASLMDescription
  288. #endif
  289.                     },
  290.  
  291.         /*    -----------------------------------------------------------------
  292.             Add the internationalized packages
  293.             ----------------------------------------------------------------- */
  294.         pickAll,    {
  295.                         /* Put Each Countries Check atoms here    */
  296. #if INTERNATIONAL
  297. #endif
  298.  
  299.                         rAddEtherTalkPackage,
  300. #if GENERATING68K
  301.                         rAddSystem6Package,
  302.                         rAddSystem7Package,
  303.                         rAddSystemAUXPackage,
  304. #endif
  305. #if GENERATINGPOWERPC
  306.                         rAddSystemPPCPackage,
  307. #endif
  308.                     }
  309.     }};
  310. };
  311.  
  312.  
  313. /*******************************************************************************
  314. ** The Easy Install framework
  315. ********************************************************************************/
  316.     
  317. resource 'infr' (kCustomInstallFrameworkRsrcID)
  318. {
  319.     format0
  320.     {{
  321.  
  322.         /*    -----------------------------------------------------------------
  323.             Report any errors that occured.
  324.             ----------------------------------------------------------------- */
  325.             
  326.         pickFirst,    {
  327.                         rReportNoSystemError,
  328. #if GENERATING68K
  329.     #if SYSTEM6
  330.                         rReportBadSystemError,
  331.     #else
  332.                         rReportSystem7OnlyError,
  333.     #endif
  334. #endif
  335. #if GENERATINGPOWERPC && !GENERATING68K
  336.                         rReportPowerPCOn68KError,
  337. #endif
  338.                     },
  339.  
  340.         /*    -----------------------------------------------------------------
  341.             Add all our custom packages.
  342.             ----------------------------------------------------------------- */
  343.  
  344.         pickAll,    {
  345.                         rAddEtherTalkCustomPackage,
  346. #if GENERATING68K
  347.                         rAddSystem6CustomPackage,
  348.                         rAddSystem7CustomPackage,
  349.                         rAddSystemAUXCustomPackage,
  350. #endif
  351. #if GENERATINGPOWERPC
  352.                         rAddSystemPPCCustomPackage
  353. #endif
  354.                     }
  355.     }};
  356. };
  357.